package cn.dkdoo.utils.config.traNo;

import cn.dkdoo.utils.common.ThreadLocalAbstract;
import org.springframework.core.NamedThreadLocal;

/**
 * Created by Nicky.Tang on 2021/5/10 11:35 下午
 *
 * @since 02.12.10
 */
public class TraNoManager implements ThreadLocalAbstract<String> {
    private static final ThreadLocal<String> troNoLocal =
            new NamedThreadLocal<>("Current TroNo");

    public String getCur() {
        return troNoLocal.get();
    }

    public void bindToThread(String troNo) {
        troNoLocal.set(troNo);
    }

    public void releaseToThread() {
        troNoLocal.remove();
    }
}
